import axios from "@/utils/requist"

export default {
	// 获取大标题接口
	course(token) {
		return axios({
			method: 'get',
			url: `classify`,
			headers: {'Authorization': `Bearer ${token}` },
		})
	},

	// 增加大标题接口
	addclassify(token,date){
		let formData = new FormData()
		formData.append('name',date)
		return axios({
			method: 'POST',
			url: `classify`,
			headers: { 'Authorization': `Bearer ${token}` },
			data: formData
		})
	},

	// 更改大标题接口
	changeClassify(token, date) {
		return axios({
			method: 'PUT',
			url: `classify`,
			headers: { 'Content-Type': `application/x-www-form-urlencoded`, 'Authorization': `Bearer ${token}` },
			data: 'pk=' + date.pk + '&name=' + date.name
		})
	}
}